﻿using System;
using System.Windows.Media;
using ICSharpCode.AvalonEdit.CodeCompletion;
using ICSharpCode.AvalonEdit.Document;
using ICSharpCode.AvalonEdit.Editing;

namespace EffectEd.CodeCompletion
{
    public class FunctionCompletionData
        : ICompletionData
    {

        public FunctionCompletionData(string text, string description)
        {
            Text = text;
            Description = description;
        }

        public string Name { get; set; }

        public void Complete(TextArea textArea, ISegment completionSegment, EventArgs insertionRequestEventArgs)
        {
            textArea.Document.Replace(completionSegment, Text + "(");
        }

        public ImageSource Image
        {
            get { return null; }
        }

        public string Text { get; private set; }

        public object Content
        {
            get { return Text; }
        }

        public object Description { get; private set; }

        public double Priority
        {
            get { return 0.0; }
        }
    }
}
